#ifndef LIBRARY__H
#define LIBRARY__H

#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <stdlib.h>
#include <ctype.h>
#include <limits.h>
#include "menu.h"
#include "user.h"
#include "loan.h"
#include "book.h"
#include "sqlite\sqlite3.h"

class library
{
	private:
		std::vector<book> books;
		std::vector<user*> users;
		std::vector<loan> loans;
		sqlite3* db;
		bool dbopen;
		bool login();
		std::string rot13(const std::string &input);
        std::vector<std::string> SQLQuery(const std::string &query);
		void CreateBook(const std::vector<std::string> &data);
		void ListBooks();
		void Querybooks(const std::string &query);
		void DeleteBook(int id);
		void LoanBook(int bookID,int userID,std::string begin);
		void ReturnBook(int id);
		void CreateUser(const std::vector<std::string> &data);
		void ListUsers();
		void ModifyUser(const std::vector<std::string> &data);
		void ListUserLoans(int id);
		void DeleteUser(int id);
	public:
		library(const std::string &database);
		~library();
		void run();
};

#endif
